package com.prs.crm.domain.crm;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.BaseEntity;
/**
 * 供应商
 * @author zhoupeng 2012-02-15
 *
 */
@Entity
@Table(name="crm_customersupplier")
public class CustomerSupplier extends BaseEntity {
	private static final long serialVersionUID = 1L;
	
	@Id@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	
	private String supcode; //供应商号
	private String name;    //供应商名称
	@ManyToOne
	private CustomerAddress address; //供应商地址
	
	@ManyToOne
	private CustomerTrade trade; //供应商行业
	@ManyToOne
	private CustomerSource source; //供应商来源
	
	private String linkman; //联系人
	private String mobile;  //手机
	private String phone;   //电话
	private String fax;     //传真
	private String email;   //E-mail
	
	@ManyToOne(fetch=FetchType.LAZY)
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private Attachment attach;
	
	@Column(name="customerSupplier_file")
	private String customerSupplier_file;
	
	private String addressT; //通讯地址
	private String youbian;  //邮政编码
	private String comweb;    //单位网站
	private String comnum;   //单位规模
	private String yearyye;   //年营业额
	
	private String remark;    //其他描述
	
	private String head;  //负责人
	private String bank;  //开户银行
	private String bankAccount;  //银行账户
	private String shuei;  //税号
	
	private String person;  //业务人员
	private String shareperson;//共享人员
	//客户
	@OneToMany(fetch=FetchType.LAZY,mappedBy="customerSupplier")
	private Set<Customer> customers;
	
	//联系人
	@OneToMany(fetch=FetchType.LAZY,mappedBy="customerSupplier")
	private Set<Linkman> linkmans;
	//跟单
	@OneToMany(fetch=FetchType.LAZY,mappedBy="customerSupplier")
	private Set<DocumenTary> documenTarys;
	//货物
	@OneToMany(fetch=FetchType.LAZY,mappedBy="customerSupplier")
	private Set<SupplierFoods> foods;
	//合同
	@OneToMany(fetch=FetchType.LAZY,mappedBy="customerSupplier")
	private Set<CustomerContract> contract;
	
	public String getHead() {
		return head;
	}

	public void setHead(String head) {
		this.head = head;
	}

	public String getBank() {
		return bank;
	}

	public void setBank(String bank) {
		this.bank = bank;
	}

	public String getBankAccount() {
		return bankAccount;
	}

	public void setBankAccount(String bankAccount) {
		this.bankAccount = bankAccount;
	}

	public String getShuei() {
		return shuei;
	}

	public void setShuei(String shuei) {
		this.shuei = shuei;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getSupcode() {
		return supcode;
	}

	public void setSupcode(String supcode) {
		this.supcode = supcode;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	

	public CustomerAddress getAddress() {
		return address;
	}

	public void setAddress(CustomerAddress address) {
		this.address = address;
	}

	public CustomerTrade getTrade() {
		return trade;
	}

	public void setTrade(CustomerTrade trade) {
		this.trade = trade;
	}

	

	public CustomerSource getSource() {
		return source;
	}

	public void setSource(CustomerSource source) {
		this.source = source;
	}

	public String getLinkman() {
		return linkman;
	}

	public void setLinkman(String linkman) {
		this.linkman = linkman;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getAddressT() {
		return addressT;
	}

	public void setAddressT(String addressT) {
		this.addressT = addressT;
	}

	public String getYoubian() {
		return youbian;
	}

	public void setYoubian(String youbian) {
		this.youbian = youbian;
	}

	public String getComweb() {
		return comweb;
	}

	public void setComweb(String comweb) {
		this.comweb = comweb;
	}

	public String getComnum() {
		return comnum;
	}

	public void setComnum(String comnum) {
		this.comnum = comnum;
	}

	public String getYearyye() {
		return yearyye;
	}

	public void setYearyye(String yearyye) {
		this.yearyye = yearyye;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Set<Customer> getCustomers() {
		return customers;
	}

	public void setCustomers(Set<Customer> customers) {
		this.customers = customers;
	}

	public Set<Linkman> getLinkmans() {
		return linkmans;
	}

	public void setLinkmans(Set<Linkman> linkmans) {
		this.linkmans = linkmans;
	}

	public Set<DocumenTary> getDocumenTarys() {
		return documenTarys;
	}

	public void setDocumenTarys(Set<DocumenTary> documenTarys) {
		this.documenTarys = documenTarys;
	}

	public Set<SupplierFoods> getFoods() {
		return foods;
	}

	public void setFoods(Set<SupplierFoods> foods) {
		this.foods = foods;
	}

	public Set<CustomerContract> getContract() {
		return contract;
	}

	public void setContract(Set<CustomerContract> contract) {
		this.contract = contract;
	}

	public String getPerson() {
		return person;
	}

	public void setPerson(String person) {
		this.person = person;
	}

	public String getShareperson() {
		return shareperson;
	}

	public void setShareperson(String shareperson) {
		this.shareperson = shareperson;
	}

	public Attachment getAttach() {
		return attach;
	}

	public void setAttach(Attachment attach) {
		this.attach = attach;
	}

	public String getCustomerSupplier_file() {
		return customerSupplier_file;
	}

	public void setCustomerSupplier_file(String customerSupplierFile) {
		customerSupplier_file = customerSupplierFile;
	}
	
}
